package tzhomestudio.framework.interfaces.config_service;

/**
 * Interface for all configuration classes in this decoders.
 *
 * @author Timur Zolotuhin (e-mail: tzolotuhin@gmail.com)
 */
public interface IConfig {
	/**
	 * Returns property, which confirm to key.
     * May return <b>null</b>.
	 */
	public String getProperty(String key);

    /**
     * Returns value of property, if exist, otherwise <b>false<b/>.
     */
    public boolean getBooleanProperty(String key);

    /**
     * Returns value of property, if exist, otherwise <b>false<b/>.
     */
    public boolean getBooleanProperty(String key, boolean defaultValue);

    /**
     * Returns value of property, if exist, otherwise <b>zero<b/>.
     */
    public int getIntegerProperty(String key);

    /**
     * Returns value of property, if exist, otherwise <b>zero<b/>.
     */
    public int getIntegerProperty(String key, int defaultValue);

    /**
     * Returns value of property, if exist, otherwise <b>zero<b/>.
     */
    public float getFloatProperty(String key);

    /**
     * Returns value of property, if exist, otherwise <b>empty string<b/>.
     */
    public String getStringProperty(String key);

    public String getStringProperty(String key, String defaultValue);

    /**
	 * This method sets property.
	 */
	public void setProperty(String key, String value);
	
	/**
	 * This method writes all properties to file config.ini.
	 */
	public void save();

    public void saveWithExit(boolean state);

    public boolean isSaveWithExit();
}
